import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
import ui.PermissionTestPanel;
import utils.LoggerUtil;

@SuppressWarnings("unused")
public class Extension implements BurpExtension {

    @Override
    public void initialize(MontoyaApi montoyaApi) {
        montoyaApi.extension().setName("PermissionTest");
        
        // 初始化日志类
        LoggerUtil.initialize(montoyaApi);

        // 右键菜单
        PermissionTestPanel permissionTestPanel = new PermissionTestPanel(montoyaApi);
        montoyaApi.userInterface().registerContextMenuItemsProvider(new MenuItemProvider(permissionTestPanel));

        // 插件面板
        montoyaApi.userInterface().registerSuiteTab("PermissionTest", permissionTestPanel);
        
        // 注册插件卸载监听器
        montoyaApi.extension().registerUnloadingHandler(permissionTestPanel::shutdown);
    }
}